#ifdef _WIN32
#pragma warning(disable:4786)
#endif

#include "syntax_base.h"
#include "parse_info.h"
#include "language.h"

#include <iostream>
using namespace std;

namespace syntax_analysis
{
	int syntax::m_called = 0;

	void syntax::init_called()
	{
		m_called = 0;
	}

	void syntax::inc_called()
	{
		++m_called;
	}

	int syntax::get_called()
	{
		return m_called;
	}

	void syntax::debug_info( parse_info * info )
	{
		parse_para *para;
		parse_info *root = info->get_root();
		cout << "*********************" << endl;
		root->print( 0 );
		cout << "=====================" << endl;
		info->print( 0 );
		cout << "---------------------" << endl;
		para = info->get_parse_para();
		para->get_language()->print_stack();
		cout << "^^^^^^^^^^^^^^^^^^^^^" << endl;
		cout << to_string() << endl;
	}

}
